<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>安全保护区在线审查系统</title>
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"
    />
    <link
      rel="stylesheet"
      href="../layuiadmin/layui/css/layui.css"
      media="all"
    />
    <link rel="stylesheet" href="../layuiadmin/style/admin.css" media="all" />
    <link rel="stylesheet" href="../layuiadmin/style/style.css" media="all" />
    <script>
      !(function (a, b) {
        "function" == typeof define && define.amd
          ? define([], b)
          : "undefined" != typeof module && module.exports
          ? (module.exports = b())
          : (a.ReconnectingWebSocket = b());
      })(this, function () {
        function a(b, c, d) {
          function l(a, b) {
            var c = document.createEvent("CustomEvent");
            return c.initCustomEvent(a, !1, !1, b), c;
          }
          var e = {
            debug: !1,
            automaticOpen: !0,
            reconnectInterval: 1e3,
            maxReconnectInterval: 3e4,
            reconnectDecay: 1.5,
            timeoutInterval: 2e3,
          };
          d || (d = {});
          for (var f in e) this[f] = "undefined" != typeof d[f] ? d[f] : e[f];
          (this.url = b),
            (this.reconnectAttempts = 0),
            (this.readyState = WebSocket.CONNECTING),
            (this.protocol = null);
          var h,
            g = this,
            i = !1,
            j = !1,
            k = document.createElement("div");
          k.addEventListener("open", function (a) {
            g.onopen(a);
          }),
            k.addEventListener("close", function (a) {
              g.onclose(a);
            }),
            k.addEventListener("connecting", function (a) {
              g.onconnecting(a);
            }),
            k.addEventListener("message", function (a) {
              g.onmessage(a);
            }),
            k.addEventListener("error", function (a) {
              g.onerror(a);
            }),
            (this.addEventListener = k.addEventListener.bind(k)),
            (this.removeEventListener = k.removeEventListener.bind(k)),
            (this.dispatchEvent = k.dispatchEvent.bind(k)),
            (this.open = function (b) {
              (h = new WebSocket(g.url, c || [])),
                b || k.dispatchEvent(l("connecting")),
                (g.debug || a.debugAll) &&
                  console.debug(
                    "ReconnectingWebSocket",
                    "attempt-connect",
                    g.url
                  );
              var d = h,
                e = setTimeout(function () {
                  (g.debug || a.debugAll) &&
                    console.debug(
                      "ReconnectingWebSocket",
                      "connection-timeout",
                      g.url
                    ),
                    (j = !0),
                    d.close(),
                    (j = !1);
                }, g.timeoutInterval);
              (h.onopen = function () {
                clearTimeout(e),
                  (g.debug || a.debugAll) &&
                    console.debug("ReconnectingWebSocket", "onopen", g.url),
                  (g.protocol = h.protocol),
                  (g.readyState = WebSocket.OPEN),
                  (g.reconnectAttempts = 0);
                var d = l("open");
                (d.isReconnect = b), (b = !1), k.dispatchEvent(d);
              }),
                (h.onclose = function (c) {
                  if ((clearTimeout(e), (h = null), i))
                    (g.readyState = WebSocket.CLOSED),
                      k.dispatchEvent(l("close"));
                  else {
                    g.readyState = WebSocket.CONNECTING;
                    var d = l("connecting");
                    (d.code = c.code),
                      (d.reason = c.reason),
                      (d.wasClean = c.wasClean),
                      k.dispatchEvent(d),
                      b ||
                        j ||
                        ((g.debug || a.debugAll) &&
                          console.debug(
                            "ReconnectingWebSocket",
                            "onclose",
                            g.url
                          ),
                        k.dispatchEvent(l("close")));
                    var e =
                      g.reconnectInterval *
                      Math.pow(g.reconnectDecay, g.reconnectAttempts);
                    setTimeout(
                      function () {
                        g.reconnectAttempts++, g.open(!0);
                      },
                      e > g.maxReconnectInterval ? g.maxReconnectInterval : e
                    );
                  }
                }),
                (h.onmessage = function (b) {
                  (g.debug || a.debugAll) &&
                    console.debug(
                      "ReconnectingWebSocket",
                      "onmessage",
                      g.url,
                      b.data
                    );
                  var c = l("message");
                  (c.data = b.data), k.dispatchEvent(c);
                }),
                (h.onerror = function (b) {
                  (g.debug || a.debugAll) &&
                    console.debug("ReconnectingWebSocket", "onerror", g.url, b),
                    k.dispatchEvent(l("error"));
                });
            }),
            1 == this.automaticOpen && this.open(!1),
            (this.send = function (b) {
              if (h)
                return (
                  (g.debug || a.debugAll) &&
                    console.debug("ReconnectingWebSocket", "send", g.url, b),
                  h.send(b)
                );
              throw "INVALID_STATE_ERR : Pausing to reconnect websocket";
            }),
            (this.close = function (a, b) {
              "undefined" == typeof a && (a = 1e3),
                (i = !0),
                h && h.close(a, b);
            }),
            (this.refresh = function () {
              h && h.close();
            });
        }
        return (
          (a.prototype.onopen = function () {}),
          (a.prototype.onclose = function () {}),
          (a.prototype.onconnecting = function () {}),
          (a.prototype.onmessage = function () {}),
          (a.prototype.onerror = function () {}),
          (a.debugAll = !1),
          (a.CONNECTING = WebSocket.CONNECTING),
          (a.OPEN = WebSocket.OPEN),
          (a.CLOSING = WebSocket.CLOSING),
          (a.CLOSED = WebSocket.CLOSED),
          a
        );
      });
    </script>
  </head>
  <body>
    <div class="layui-fluid">
      <div class="technicalReviewHeader">
        <h3 class="technicalReviewTit"></h3>
        <div class="technicalReviewTitBtn">
          <a href="javascript:;" lay-href="technicalReview.html">
            <button type="button" class="layui-btn">
              <i class="layui-icon layui-icon-template"></i>
              技审待办<span>5</span>项
            </button>
          </a>
          <a href="javascript:;">
            <button type="button" class="layui-btn">
              <i class="layui-icon layui-icon-group"></i>
              会议通知<span>1</span>项
            </button>
          </a>
        </div>
      </div>
      <div class="dataListTable">
        <!--  -->
        <div class="btnBox">
          <div class="leftBtn"><i class="layui-icon layui-icon-left"></i></div>
          <div class="rightBtn">
            <i class="layui-icon layui-icon-right"></i>
          </div>
        </div>
        <!-- 头部 -->
        <div class="thead"></div>
        <!-- 内容 -->
        <div class="tbody">
          <div class="content">
            <div class="rowTimeAm">
              <div class="dayBox">
                <span class="dayAfter">上午</span>
                <span class="dayAfterEng">am</span>
              </div>
            </div>
            <div class="rowTxt">
              <div class="aMmonday">
                <div class="gg">
                  <ul class="aMmondayGG"></ul>
                </div>
                <div class="gr">
                  <ul class="aMmondayGR"></ul>
                </div>
              </div>
              <div class="aMtuesday">
                <div class="gg">
                  <ul class="aMtuesdayGG"></ul>
                </div>
                <div class="gr">
                  <ul class="aMtuesdayGR"></ul>
                </div>
              </div>
              <div class="aMwednesday">
                <div class="gg">
                  <ul class="aMwednesdayGG"></ul>
                </div>
                <div class="gr">
                  <ul class="aMwednesdayGR"></ul>
                </div>
              </div>
              <div class="aMthursday">
                <div class="gg">
                  <ul class="aMthursdayGG"></ul>
                </div>
                <div class="gr">
                  <ul class="aMthursdayGR"></ul>
                </div>
              </div>
              <div class="aMfriday">
                <div class="gg">
                  <ul class="aMfridayGG"></ul>
                </div>
                <div class="gr">
                  <ul class="aMfridayGR"></ul>
                </div>
              </div>
            </div>
          </div>
          <div class="content">
            <div class="rowTimePm">
              <div class="dayBox">
                <span class="dayAfter">下午</span>
                <span class="dayAfterEng">pm</span>
              </div>
            </div>
            <div class="rowTxt2">
              <div class="pMmonday">
                <div class="gg">
                  <ul class="pMmondayGG"></ul>
                </div>
                <div class="gr">
                  <ul class="pMmondayGR"></ul>
                </div>
              </div>
              <div class="pMtuesday">
                <div class="gg">
                  <ul class="pMtuesdayGG"></ul>
                </div>
                <div class="gr">
                  <ul class="pMtuesdayGR"></ul>
                </div>
              </div>
              <div class="pMwednesday">
                <div class="gg">
                  <ul class="pMwednesdayGG"></ul>
                </div>
                <div class="gr">
                  <ul class="pMwednesdayGR"></ul>
                </div>
              </div>
              <div class="pMthursday">
                <div class="gg">
                  <ul class="pMthursdayGG"></ul>
                </div>
                <div class="gr">
                  <ul class="pMthursdayGR"></ul>
                </div>
              </div>
              <div class="pMfriday">
                <div class="gg">
                  <ul class="pMfridayGG"></ul>
                </div>
                <div class="gr">
                  <ul class="pMfridayGR"></ul>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="addaaa" id="addSchedule">
        <i class="layui-icon layui-icon-rss"></i>添加个人日程
      </div>
    </div>
    <!-- 弹框 -->
    <div class="model">
      <i class="layui-icon layui-icon-close closeBtn"></i>
      <h3>个人日程</h3>
      <form class="layui-form" action="" lay-filter="layuiadmin-app-form-list">
        <div class="layui-form-item">
          <label class="layui-form-label">标题</label>
          <div class="layui-input-block">
            <input
              type="text"
              name="title"
              lay-verify="required"
              autocomplete="off"
              class="layui-input"
            />
          </div>
        </div>
        <div class="layui-form-item">
          <input type="hidden" id="appointmentDate" value="6,7" />
          <label class="layui-form-label">开始时间</label>
          <div class="layui-input-block">
            <div class="layui-col-md4">
              <input
                type="text"
                id="startDatePerson"
                name="startDate"
                style="border-right: 0"
                class="layui-input"
                placeholder="yyyy-mm-dd"
                autocomplete="off"
                lay-verify="required"
              />
            </div>
            <div class="layui-col-md8">
              <input
                type="text"
                id="starTimePerson"
                name="starTime"
                style="border-left: 0"
                class="layui-input"
                placeholder="hh:mm"
                autocomplete="off"
                lay-verify="required"
              />
            </div>
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">结束时间</label>
          <div class="layui-input-block">
            <div class="layui-col-md4">
              <input
                type="text"
                id="endDatePerson"
                name="endDate"
                style="border-right: 0"
                class="layui-input"
                placeholder="yyyy-mm-dd"
                autocomplete="off"
                lay-verify="required"
              />
            </div>
            <div class="layui-col-md8">
              <input
                type="text"
                id="endTimePerson"
                name="endTime"
                style="border-left: 0"
                class="layui-input"
                placeholder="hh:mm"
                autocomplete="off"
                lay-verify="required"
              />
            </div>
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">地点</label>
          <div class="layui-input-block">
            <input
              type="text"
              name="address"
              lay-verify="required"
              autocomplete="off"
              class="layui-input"
            />
          </div>
        </div>

        <div class="layui-form-item layui-form-text">
          <label class="layui-form-label">备注</label>
          <div class="layui-input-block">
            <textarea class="layui-textarea" name="remark"></textarea>
          </div>
        </div>
        <div class="layui-form-item">
          <div class="layui-form-item" id="urltop">
            <label class="layui-form-label">附件</label>
            <div class="layui-input-block"></div>
          </div>
          <div class="layui-upload">
            <button
              type="button"
              class="layui-btn layui-btn-normal"
              id="testList"
            >
              选择多文件
            </button>
            <div class="layui-upload-list">
              <table
                class="layui-table layui-upload-table"
                style="overflow-y: auto"
              >
                <thead>
                  <tr>
                    <th>文件名</th>
                    <th>大小</th>
                    <th>状态</th>
                    <th>操作</th>
                  </tr>
                </thead>
                <tbody id="demoList" style="height: 10px"></tbody>
              </table>
            </div>
            <button type="button" class="layui-btn" id="testListAction">
              开始上传
            </button>
          </div>
        </div>
        <div class="uploadBox"></div>
        <div class="layui-form-item" style="text-align: center">
          <button class="layui-btn" lay-submit lay-filter="formDemo">
            立即提交
          </button>
        </div>
      </form>
    </div>

    <script type="text/html" id="meetingInformationForm">
      <form lay-filter="meetingInformationForm" class="layui-form model-form">
        <div class="layui-form-item">
          <label class="layui-form-label">会议名称</label>
          <div class="layui-input-block">
            <input name="title" type="text" class="layui-input" disabled />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">会议时间</label>
          <div class="layui-input-block">
            <input
              type="text"
              class="layui-input"
              name="meetingTime"
              disabled
            />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">会议地点</label>
          <div class="layui-input-block">
            <input type="text" class="layui-input" name="address" disabled />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">会议召集</label>
          <div class="layui-input-block">
            <input
              type="text"
              class="layui-input"
              name="meetingUserid"
              disabled
            />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">会议备注</label>
          <div class="layui-input-block">
            <textarea
              class="layui-textarea"
              name="meetingRemarks"
              disabled
            ></textarea>
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">参会反馈</label>
          <div class="layui-input-block">
            <textarea class="layui-textarea" name="ackMsgs" disabled></textarea>
          </div>
        </div>
        <div class="layui-form-item meetingScheduleBtn">
          <button class="layui-btn meetingNotice" type="button">
            会议通知单
          </button>
          <a
            class="layui-btn enterMeeting"
            href="#"
            target="_blank"
            rel="noopener noreferrer"
            >进入会议</a
          >
        </div>
      </form>
    </script>
    <h3 id="ids"></h3>
    <script type="text/html" id="messageNotificationForm">
      <div class="messageNotification"></div>
    </script>
    <script src="../layuiadmin/layui/layui.js?t=1"></script>
    <script src="../layuiadmin/modules/const_config.js"></script>
    <script src="../layuiadmin/modules/jquery.min.js"></script>

    <!-- <script src="../layuiadmin/modules/messageNotification.js"></script> -->
    <script>
      layui
        .config({
          base: "../layuiadmin/", //静态资源所在路径
        })
        .extend({
          index: "lib/index", //主入口模块
        })
        .use(["index", "home"], function () {
          var address = "172.20.41.71:7071";
          var token = layui.sessionData("userToken").key;
          //下面ws/ 后面是用户token
          var url = "ws://" + address + "/ws/" + token.split(" ")[1];
          //判断浏览器是否支持websocket
          if ("WebSocket" in window) {
            //如果支持，创建websocket对象，注意url格式
            websocket = new ReconnectingWebSocket(url);
            websocket.debug = true;
            //websocket.timeoutInterval=2000;重连的最长等待时间
          } else {
            alert("浏览器版本不支持websocket！");
          }
          //定义连接错误的回调方法
          websocket.onerror = function () {
            console.log("websocket连接出错！");
          };
          //定义连接成功的回调方法
          websocket.onopen = function () {
            console.log("websocket连接成功！");
          };
          //定义websocket关闭的回调方法
          websocket.onclose = function () {
            console.log("websocket已关闭！");
          };

          //当窗口关闭时，主动去关闭websocket连接
          window.onbeforeunload = function () {
            closeWebSocket();
          };

          //接收到消息的回调方法
          websocket.onmessage = function (event) {
            console.log(event.data);
            var arr = JSON.parse(event.data);
            var newData = arr["data"];

            if (arr["type"] == "message") {
              newData.forEach((element) => {
                layer.open({
                  type: 1,
                  offset: "t",
                  area: ["20%", "20%"],
                  content:
                    '<div class="messageBox">' +
                    '<div class="messageIcon"><i class="layui-icon layui-icon-dialogue"></i></div>' +
                    "<div data-id=" +
                    element.id +
                    ">" +
                    element.content +
                    "</div></div>",
                  shade: 0, //不显示遮罩
                  success: function (layero, index) {
                    // $(".messageNotification").html();
                  },
                  cancel: function (index, layero) {
                    $.ajax({
                      type: "GET",
                      async: true, //异步执行
                      url: base_url + "/messages/updateMessage" + value,
                      headers: {
                        Accept: "application/json; charset=utf-8",
                        Authorization: layui.sessionData("userToken").key,
                      },
                      success: function (data) {
                        if (data.type == "success") {
                          debugger;
                        }
                      },
                    });
                  },
                });
              });
            }
          };
        });
    </script>
  </body>
</html>
